A microcontroller is an integrated circuit that may be used in a wide variety of applications, and typically includes a processor or control unit, input/output units, and embedded memory, such as random access memory (“RAM”) and read only memory (“ROM”).
One type of microcontroller further includes embedded erasable/programmable non-volatile memory, such as flash memory. This type of microcontroller is typically designed to execute only internal memory instructions (i.e., instructions originating from inside the microcontroller) on the embedded non-volatile memory. In this type of microcontroller, no address or data signals, or only partial address/data signals, can be monitored from outside the device. Therefore, internal memory operations cannot be monitored from outside the microcontroller.
In order to program instructional data or firmware onto the embedded non-volatile memory of this type of microcontroller during production, a special mode is created that allows data to be multiplexed onto the embedded non-volatile memory from one or more input/output pins. The special mode is typically activated by communicating a predetermined sequence of signals to the input/output pins.
While this special mode allows firmware to be efficiently installed within the microcontroller, it also will allow external circuits to read back the contents of the non-volatile memory. Hence, the firmware stored within the non-volatile memory could potentially be read out and duplicated by an unauthorized party accessing the special mode.
It is therefore desirable to provide a microcontroller having embedded erasable/programmable non-volatile memory which overcomes the foregoing drawbacks of prior microcontrollers and which has the ability to prevent access to data stored within the embedded non-volatile memory while the microcontroller is operating in a special mode.
In U.S. patent application Ser. No. 10/052,327 filed on Jan. 17, 2002, a microcontroller is disclosed as having an embedded erasable/programmable non-volatile memory. A read protection flag is stored in the memory. When the special mode is activated and an external read operation commences, and if the read protection flag is set, the entire memory is erased, thereby thwarting any access of the content of the memory in the external read mode.